﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace StockMonitor
{
    public partial class FormRiskSetting : Form
    {
        public FormRiskSetting()
        {
            InitializeComponent();
        }

        private void btn_setting_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.textBox1.Text))
            {
                this.textBox1.Focus();
                return;
            }
            ClientTradeRisk.Instance.UintNetValueRiskControlEnable = this.checkBox1.Checked;
            
            var val = double.Parse(this.textBox1.Text);
            ClientTradeRisk.Instance.Price = val;
            ClientTradeRisk.Instance.UintNetValueRiskControlEnable = true;
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
